<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<title>新建企业分店</title>
<%@include file="../collect/meta.jsp"%>
<style type="text/css">
.tbinput {
	width: 180px;
	height: 25px;
	font-size: 14px;
	background-color: #FFFFCC;
}
</style>
<link rel="stylesheet" href="css/radius.css" type="text/css"></link>
<link rel="stylesheet" href="css/Inputstyle.css" type="text/css"></link>
<link rel="stylesheet" href="css/mshop.css" type="text/css"></link>
<script type="text/javascript" src="${ctx}/js/returnTop.js"></script>
</head>
<body lang="zh-cn">
	<div class="wrapper">
		<c:import url="/collect/top.jsp"></c:import>
		<div class="main-container" id="main-container">
			<div class="main-container-inner">
				<c:import url="/collect/left.jsp"></c:import>
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<ul class="breadcrumb">
							<li><i class="icon-home home-icon"></i>分店管理</li>
							<li><a href="mshop!getAllStore">企业分店</a></li>
							<li>新增分店</li>
						</ul>
						<!-- .breadcrumb -->
					</div>
					<div class="page-content">
						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
								<form action="mshop!addStore" name="addstore" method="post">
									<div align="center">
										<div class="common" style="display:none;">
											<label for="three">Image:&nbsp;</label> <input type="text"
												class="input" id="three" name="shop.image" />
											<div align="left" id="three"></div>
										</div>
										<div class="common">
											<label for="one">分店名称:&nbsp;</label> <input type="text"
												class="input" id="one" name="shop.name" />
											<div id="content" class="cont"></div>
										</div>
										<div class="shopclass">
											<label>分店类型:&nbsp;</label> <label><input type="radio"
												name="shop.type" id="zhiying" value="直营" checked="checked">直营</label>
											<label><input type="radio" name="shop.type"
												id="jiameng" value="加盟">加盟</label> <label><input
												type="radio" name="shop.type" id="qita">其它</label> <br>
											<input type="text" class="input shoptype" id="shopType"
												name="shopType" style="display: none;">
										</div>
										<div class="common">
											<label for="two">分店地址:&nbsp;</label> <input type="text"
												class="input" id="two" name="shop.address" />
										</div>
										<div id="btn-team">
											<input type="button" class="btn btn-primary radius" id="but"
												value="添加" /> <input type="button"
												class="btn btn-primary radius" id="but" value="返回"
												onclick="window.location='/shop/mshop!getAllStore'" />
										</div>
										<div class="common">
											<input type="hidden" name="shop.eaId" value="${shop.eaId }" />
											<input type="hidden" name="shop.id" value="${shop.id }" />
										</div>
										<div class="common" style="display:none;">
											<label for="two">百度地址横坐标:&nbsp;</label> <input type="text"
												class="input" id="fover" name="shop.x" value="${shop.x}" />
										</div>
										<div class="common" style="display:none;">
											<label for="two">百度地址纵坐标:&nbsp;</label> <input type="text"
												class="input" id="five" name="shop.y" value=" ${shop.y}" />
										</div>
									</div>
								</form>
								<!-- PAGE CONTENT ENDS -->
							</div>
							<!-- /.col -->
						</div>
						<!-- /.row -->
					</div>
					<!-- /.page-content -->
				</div>
				<!-- /.main-content -->
			</div>
			<!-- /.main-container-inner -->
			<a href="#" id="btn-scroll-up"
				class="btn-scroll-up btn btn-sm btn-inverse"
				style="position:fixed;bottom:0;"> <i
				class="icon-double-angle-up icon-only bigger-110"></i> </a>
		</div>
		<!-- /.main-container -->
		<div class="push"></div>
	</div>
	<c:import url="/collect/down.jsp"></c:import>

	<script type="text/javascript">
		$(document)
				.ready(
						function() {
							var nu = /\s/;
							var str = /[\ |\~|\`|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\_|\+|\=|\||\\|\[|\]|\{|\}|\;|\:|\"|\'|\,|\<|\.|\>|\/|\?]/;
							$("input[id='one']").focus(function() {
								$(this).addClass("tbinput");
							});
							$("input[id='one']").blur(
									function() {
										$(this).removeClass("tbinput");
										var one = $(this).val();
										if (!nu.test(one) && !str.test(one)) {
											if (one.length != 0) {
												$("div[id='content']").html(
														"确认").removeClass(
														"error").addClass(
														"success");
											} else {
												$("div[id='content']").html(
														"必填").removeClass(
														"success").addClass(
														"error");
											}
										} else {
											$("div[id='content']").html(
													"含有特殊字符").removeClass(
													"success")
													.addClass("error");
										}
									});

							$("#but")
									.click(
											function() {
												var one = $(
														"div[id='content']")
														.text();
												if (one != "确认") {
													alert("请填写分店名称");
													return false;
												}
												if ($("#qita").is(":checked") == true) {
													if ($("#qita").val() == ""
															|| $("#qita").val() == "on") {
														alert("请填写其它类型！");
														return false;
													}
												}

												addstore.submit();
											});

							$("#zhiying").click(function() {
								$("#shopType").css("display", "none");
							})
							$("#jiameng").click(function() {
								$("#shopType").css("display", "none");
							})
							$("#qita").click(function() {
								$("#shopType").css("display", "block");
							})
							$("#shopType").change(function() {
								$("#qita").val($(this).val());
							})

						});
		//防dropmenu刷新收回($企业分店：新增分店)
		$(document).ready(function() {
			$('.fendianguanli > ul').show();
			$('.fendianguanli > ul > li > a').eq(0).css("color", "red");
		});
	</script>
</body>
</html>